﻿  <?php
	session_start();
	include_once('metier/montontonPDO.php');
	
	$sql_handler = new montontonPDO();
	if($_SESSION["connecte"] == true) header('Location: session.base.php');
	else if(!isset($_POST["connecte"])) $sql_handler->creerUtilisateur($_POST['session_useraddress'], hash('sha256',$_POST['session_userpwd']));
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Enregistrez vous</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="css/bootstrap.css" rel="stylesheet">
	<link href="css/style_login.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
  </head>

  <body>

    <div class="container">

      <form class="form-signin" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
        <h2 class="form-signin-heading">Enregistrez vous</h2>
		<input type="text" class="input-block-level" placeholder="Adresse email" name="session_useraddress">
        <input type="password" class="input-block-level" placeholder="Mot de passe" name="session_userpwd">
		<input type="password" class="input-block-level" placeholder="Confirmer mot de passe" name="session_userpwdconfirm">
		<label class="checkbox">
          <input type="checkbox" value="promoteur"> Promoteur
        </label>
        <button class="btn btn-large btn-primary" type="submit">S'enregistrer</button>
      </form>

    </div>
    <script src="js/jquery.js"></script>

  </body>
</html>
